package define;

public class ArgumentsDemo {
    public static void swap(int x, int y) {  //这里是方法定义，所以x,y是形参
        int temp;
        temp = x;
        x = y;
        y = temp;
        System.out.println("in swap: x=" + x);
        System.out.println("in swap: y=" + y);
    }

    public static void main(String[] args) {
        int x = 10;
        int y = 7;
        swap(x, y); //这里是方法调用,所以x,y是实参。
        System.out.println("x=" + x);
        System.out.println("y=" + y);

    }
}
